package example.step1;

public class ObjectStatus {

    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    // test
    @Override
    public String toString() {
        return "ObjectStatus [name=" + name + ", age=" + age + "]";
    }

    public static void main(String args[]) {
        // 构造对象，该对象为一个初始状态
        ObjectStatus obj = new ObjectStatus();
        // obj的状态改变
        obj.setName("LangYu");
        obj.setAge(1);
        System.out.println(obj);
        // obj的状态改变
        obj.setAge(3);
        System.out.println(obj);
        // obj的状态改变
        obj.setAge(10);
        obj.setName("Lang Yu");
    }
}
